In This Topic
    In This Topic

    The following example demonstrates how to provide, through a style, a new InsertionRow template. In order to preserve the fixed-column splitter in the insertion row, we need to use a FixedCellPanel as the "PART_CellsHost" template part.

    XAML
    Copy Code
    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
      <Grid.Resources>
        <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                        Source="{Binding Source={x:Static Application.Current},
                                                            Path=Orders}"/>
       <Style x:Key="insertionrow_style"
              TargetType="{x:Type xcdg:InsertionRow}">
         <Setter Property="Template">
           <Setter.Value>
             <ControlTemplate TargetType="{x:Type xcdg:InsertionRow}">
                <Expander Header="Insert New Data">
                  <Border BorderBrush="LightBlue"
                          BorderThickness="0, 1, 0, 1">
                   <xcdg:FixedCellPanel x:Name="PART_CellsHost"
                      FixedCellCount="{xcdg:ViewBinding FixedColumnCount, Mode=TwoWay}"
                      SplitterStyle="{TemplateBinding xcdg:TableView.FixedColumnSplitterStyle}"
                      SplitterWidth="{xcdg:ViewBinding FixedColumnSplitterWidth}"
                      ShowSplitter="{xcdg:ViewBinding ShowFixedColumnSplitter}"
                      FixedColumnDropMarkPen="{xcdg:ViewBinding FixedColumnDropMarkPen}"
                      Background="LightBlue"/>
                  </Border>
                </Expander>
             </ControlTemplate>
           </Setter.Value>
         </Setter>
       </Style>
      </Grid.Resources>
      <xcdg:DataGridControl x:Name="OrdersGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_orders}}">
        <xcdg:DataGridControl.View>
          <xcdg:TableView>
            <xcdg:TableView.FixedFooters>
             <DataTemplate>
               <xcdg:InsertionRow Style="{StaticResource insertionrow_style}"/>
             </DataTemplate>
            </xcdg:TableView.FixedFooters>
          </xcdg:TableView>
        </xcdg:DataGridControl.View>
      </xcdg:DataGridControl>   
    </Grid>